#include "TcpClient.hpp"
#include <memory>
using namespace std;

static void Usage(string msg)
{
    cout << "\nUsage:\n\t" << msg << " ServerIP   Serverport\n\n"
         << endl;
}

// ./tcpclient 127.0.0.1 8080
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    string serverip = argv[1];
    uint16_t serverport = atoi(argv[2]);

    unique_ptr<TcpClient> upt(new TcpClient(serverip,serverport));
    upt->InitClient();
    upt->Start();

    return 0;
}